/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MvpDispatchExampleMain.java
 *
 * Created on 13.05.2011, 12:48:34
 */
package com.pennychecker.example;

import com.google.inject.Guice;
import com.google.inject.Injector;
import com.pennychecker.example.handler.guice.ActionModule;
import com.pennychecker.example.mvp.presenter.UserContainerPresenter;
import com.pennychecker.example.mvp.guice.MvpModule;

/**
 *
 * @author Steffen Kämpke mailto:steffen.kaempke@pennychecker.de
 */
public class MvpDispatchExampleMain extends javax.swing.JFrame {
    private static final long serialVersionUID = 1L;

    /** Creates new form MvpDispatchExampleMain */
    public MvpDispatchExampleMain() {
        initComponents();

        final Injector injector = Guice.createInjector(new ActionModule(), new MvpModule());
        final UserContainerPresenter userContainerPresenter = injector.getInstance(UserContainerPresenter.class);
        this.add(userContainerPresenter.getDisplay().asComponent());
        
        pack();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MvpDispatchExampleMain().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
